﻿<html>
<head>
  <title>Simply Weather Settings</title>
  <style type="text/css">
    body { margin: 0; width: 300px; height: 380px; }
    img { float: left; margin-right: 15px; height: 32; width: 32; }
    div { margin-bottom: 8px; }
    fieldset { text-align: center; padding: 7px 0; }
    input { margin-top: 3px; }
    #loc { width: 225px; }
    #wp, #custom_title { width: 300px; }
    #instructions { line-height: 15px; }
  </style>
  <script type="text/javascript">
    function load()
    {
      loc.value = System.Gadget.Settings.readString("location");
      if (loc.value == "") loc.value = 48108;

      cel.checked = System.Gadget.Settings.readString("celsius") == "true";
      wp.value = System.Gadget.Settings.readString("wp");
      System.Gadget.onSettingsClosing = onClosing;
      version.innerHTML = System.Gadget.version;
      custom_title.value = System.Gadget.Settings.readString("custom_title");
    }

    function onClosing(event)
    {
      if (event.closeAction == event.Action.commit)
      {
        System.Gadget.Settings.writeString("location", loc.value);
        System.Gadget.Settings.writeString("celsius", cel.checked ? "true" : "false");
        System.Gadget.Settings.writeString("wp", wp.value);
        System.Gadget.Settings.writeString("custom_title", custom_title.value);
      }

      event.cancel = false;
    }
    
  </script>
</head>
<body onload="load()">
  <div>
    Location:<br />
    <input id="loc" type="text" />
    <input id="cel" type="checkbox" />
    Celsius
  </div>
  <div id="instructions">
    &bull; US postal code (90120)<br />
    &bull; Canadian postal code (V9B1A7)<br />
    &bull; City, state - US or Canadian (Detroit, MI)<br />
    &bull; City, country - Must be unique a combination<br />
    &nbsp;&nbsp;(Victoria, BC works, but not Victoria, Canada)<br />
    &bull; Add &amp;hl=language code (Paris, France&amp;hl=fr)<br />
    &nbsp;&nbsp;<a href="http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes">ISO 639-1 Language Code</a>
  </div>
  <div>
    Custom Weather Page:<br />
    <input id="wp" type="text" />
  </div>
  <div>
    Custom Title (replaces the location name):<br />
    <input id="custom_title" type="text" />
  </div>
  <div>
    &bull; <i>Click location name for custom weather page</i><br />
    &bull; <i>Click current temperature to change formats</i><br/>
    &bull; <i>Use the mouse wheel to change backgrounds</i>
  </div>
  <div style="text-align: right">
    by <a href="http://blueonionsoftware.com" onfocus="this.hideFocus=true;">Blue Onion Software</a><br />
    <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=5966770" onfocus="this.hideFocus=true;">Donate</a>
  </div>
    Now on the Web! <a href="http://simplyweather.net">http://SimplyWeather.net</a><br />
    version: <span id="version"></span>
</body>
</html>
